package com.ask.common.exception;

import com.ask.common.enumeration.ResultCode;

/**
 * 基础异常类，可传入错误码以及错误信息
 */
public class BaseException extends RuntimeException{
    private final Integer errorCode;  // 错误码


    public BaseException(String msg) {
        super(msg);
        this.errorCode = ResultCode.ERROR.getCode();
    }

    public BaseException(Integer errorCode, String msg) {
        super(msg);
        this.errorCode = errorCode;
    }

    public Integer getErrorCode() {
        return errorCode;
    }
}
